package com.ruoyi.goods.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.goods.domain.BmBrand;
import com.ruoyi.goods.domain.BmGoods;
import com.ruoyi.goods.service.IBmBrandService;
import com.ruoyi.goods.service.IBmGoodsService;
import com.ruoyi.goods.service.SellerBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Author 白大帅
 * @Date: 2023/08/11/ 16:43
 */
@RestController
@RequestMapping("/seller/brand")
public class SellerBrandController extends BaseController {
    @Autowired
    private IBmBrandService bmBrandService;

    @Autowired
    private SellerBrandService sellerBrandService;

    @GetMapping("/bNameList")
    public AjaxResult bNameList(BmBrand bmBrand) {
        List<BmBrand> list = bmBrandService.selectBmBrandList(bmBrand);
        return AjaxResult.success(list);
    }

    /**
     * 查询商品信息管理列表
     */
    @GetMapping("/goodslist")
    public AjaxResult list(BmGoods bmGoods)
    {
        List<BmGoods> list = sellerBrandService.getGoods(bmGoods);
        return AjaxResult.success(list);
    }

    /**
     * 查询商品信息管理列表
     */
    @PostMapping("/goodslist2")
    public AjaxResult list2(@RequestBody Map<String, Object> map)
    {
        List<Map<String, Object>> list = sellerBrandService.getList(map);
        return AjaxResult.success(list);
    }

    @GetMapping("/recommondGoodslist")
    public AjaxResult recommondGoodsList(BmGoods bmGoods)
    {
        List<BmGoods> list = sellerBrandService.recommondGoods(bmGoods);
        return AjaxResult.success(list);
    }

    @GetMapping("/oftenBuy")
    public AjaxResult oftenBuy()
    {
        List<Map<String,Object>> list = sellerBrandService.oftenBuy();
        return AjaxResult.success(list);
    }

}
